import http from '@/common/api/request'
import {getToken} from '@/request/token'

export function writeComment(comment){
  return http.$axios({
    url:'/comment/write',
    method:'post',
    headers:{
      token:getToken()
    },
    data:{
      'userId':comment.userId,
      'articleId':comment.articleId,
      'content':comment.content,
      'parentId':comment.parentId
    }
  })
    
}

export function findCommentByArticleId(id){
  return http.$axios({
    url:'/comment/'+id
  })
}